Skip to content

feat: Include and exclude targets by tag for deployments and runbook runs - #585

Open
bec-callow-oct wants to merge 7 commits into
mainfrom
fnm/include-exclude-targets-by-tag
Open

feat: Include and exclude targets by tag for deployments and runbook runs#585
bec-callow-oct wants to merge 7 commits into
mainfrom
fnm/include-exclude-targets-by-tag

Conversation

@bec-callow-oct

@bec-callow-oct bec-callow-oct commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Adds two new flags for specific and excluded target tag names on deployments and runbook runs:

  • --specific-target-tag
  • --excluded-target-tag
    The new tags accept single target tag canonical names and can be used more than once if including/excluding multiple tags.

Fixes SI-115

Requires the changes in this client PR OctopusDeploy/go-octopusdeploy#409

Interactive flow for specific target tags:
image

Interactive flow for excluded target tags:
image

Both include and exclude in a single command:
image

Multiple specific targets:
image

Multiple excluded targets:
image

Tags that don't exist
image

image image

@bec-callow-oct
bec-callow-oct requested a review from a team April 14, 2026 00:45
@bec-callow-oct
bec-callow-oct marked this pull request as ready for review April 14, 2026 00:45
@bec-callow-oct
bec-callow-oct force-pushed the fnm/include-exclude-targets-by-tag branch from d35d014 to c4db39c Compare August 27, 2026 02:20

@mik-ky mik-ky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While playing around in interactive mode, I noticed runbooks don't allow you to change the additional/advanced options:

➜ ./octopus runbook run --project TagTest --name TagRunbook --environment Development
Runbook TagRunbook
Environments Development
Additional Options:
  Run At: Now
  Skipped Steps: None
  Guided Failure Mode: Use default setting from the target environment
  Priority: Do not jump the task queue
  Package Download: Use cached packages (if available)
  Run Targets: All included
  Target Tags: All included
? Change additional options? Change
? Scheduled start time Now
? Guided Failure Mode Use default setting from the target environment
? Package download Use cached packages (if available)
? Steps to skip (If none selected, run all steps)
? Run targets (If none selected, run on all)

Automation Command: octopus runbook run --space 'Default' --project 'TagTest' --name 'TagRunbook' --environment 'Development' --no-prompt
Successfully started 1 runbook run(s)

which is in contrast to deployments:

❯ ./octopus release deploy --project TagTest --version 0.0.1 --environment Development
Project TagTest
Release 0.0.1
Environments Development
Additional Options:
  Deploy Time: Now
  Skipped Steps: None
  Guided Failure Mode: Use default setting from the target environment
  Priority: Use default setting from the lifecycle phase
  Package Download: Use cached packages (if available)
  Deployment Targets: All included
  Target Tags: All included
? Change additional options? Change
? Scheduled start time Now
? Steps to skip (If none selected, run all steps)
? Guided Failure Mode Do not use guided failure mode
? Package download Use cached packages (if available)
? Deployment targets (If none selected, deploy to all)
? Specific target tags to include (If none selected, include all) Default Target Tags/cloud-region

Automation Command: octopus release deploy --space 'Default' --project 'TagTest' --version '0.0.1' --environment 'Development' --guided-failure 'false' --specific-target-tag 'Default Target Tags/cloud-region' --no-prompt
Successfully started 1 deployment(s)

Other than that one inconsistency, they are looking great.

bec-callow-oct and others added 2 commits August 27, 2026 13:36
Interactive runbook run listed target tags in the additional options
summary but never asked about them, so they could only be set via
flags. Release deploy already prompts, making the two inconsistent.

Ask for the tags to include (and to exclude, when none were included)
after the run targets question, for both database and Git runbooks,
matching the release deploy flow.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Three groups of failures after merging main:

- PrintAdvancedSummary expectations predate the "Target Tags" line, as
  main's --priority tests were written before it existed.

- Two interactive deploy tests deadlocked: they answer "Change" and so
  now reach the target tags step, which fetches a deployment preview
  the mock server was never told to serve. Two scheduled start time
  tests hit the same problem. Serve the extra preview; the responses
  declare no tag sets, so the tag questions are skipped.

- The "doesn't ask if all opts are supplied" tests no longer supplied
  every advanced option once target tags joined the set, so they were
  offered the additional options question and hung waiting on it. Give
  them a tag option so they cover what their name describes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants